CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

include_directories(${PROJECT_ROOT})
include_directories(${PROJECT_ROOT}/comn/include)
include_directories(${PROJECT_ROOT}/LitePlayer/include)
include_directories(${PROJECT_ROOT}/LitePlayer/core)
include_directories(${PROJECT_ROOT}/LitePlayer/util)
include_directories(.)

include_directories(${FFMPEG_INCLUDE_DIR})

link_directories(${PROJECT_ROOT}/comn/lib)
link_directories(${PROJECT_ROOT}/lib)
link_directories(${FFMPEG_LIBRARY_DIR})
link_directories(${THIRD_PARTY}/SDL2/lib/x86)
link_directories(${THIRD_PARTY}/SDL2/lib)

include_directories(${PROJECT_ROOT}/MediaWriter)



aux_source_directory(. SOURCE)
SET(UTIL_SOURCE 
	${PROJECT_ROOT}/LitePlayer/util/FfmpegUtil.cpp 
	${PROJECT_ROOT}/LitePlayer/util/ScaleContext.cpp
	${PROJECT_ROOT}/LitePlayer/util/AVFrameUtil.cpp
	${PROJECT_ROOT}/LitePlayer/util/ParamSet.cpp
	)

FILE(GLOB HEADER "*.h")


add_library(MediaDecoder SHARED ${SOURCE} ${HEADER} ${UTIL_SOURCE} MediaDecoder.rc)

target_link_libraries(MediaDecoder
    debug comnd optimized comn
	${LIB_PLATFORM}
	LitePlayer
	${FFMPEG_LIBRARIES}
	debug MediaWriterd optimized MediaWriter
	)

set_target_properties(MediaDecoder PROPERTIES LINK_INTERFACE_LIBRARIES "")
set_target_properties(MediaDecoder PROPERTIES INTERFACE_LINK_LIBRARIES "")
set_target_properties(MediaDecoder PROPERTIES LINK_FLAGS_RELEASE "/OPT:NOREF")


install(TARGETS MediaDecoder DESTINATION lib)

install(FILES ${PROJECT_ROOT}/MediaDecoder/LibMediaDecoder.h DESTINATION MediaDecoder)